<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>#MaxThreadsPerHotkey</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>#MaxThreadsPerHotkey</h1>

<p>Sets the maximum number of simultaneous <a href="../misc/Threads.htm">threads</a> per <a href="../Hotkeys.htm">hotkey</a> or <a href="../Hotstrings.htm">hotstring</a>.</p>

<pre class="Syntax">#MaxThreadsPerHotkey Value</pre>
<h3>Parameters</h3>
<dl>

  <dt>Value</dt>
  <dd><p>The maximum number of <a href="../misc/Threads.htm">threads</a> that can be launched for a given hotkey/hotstring subroutine (limit 255).</p></dd>

</dl>
<h3>Remarks</h3>
<p>This setting is used to control how many &quot;instances&quot; of a given <a href="../Hotkeys.htm">hotkey</a> or <a href="../Hotstrings.htm">hotstring</a> subroutine are allowed to exist simultaneously. For example, if a hotkey has a max of 1 and it is pressed again while its subroutine is already running, the press will be ignored. This is helpful to prevent accidental double-presses. However, if you wish  these keypresses to be buffered rather than ignored -- perhaps to increase the responsiveness of the keyboard's auto-repeat feature --  use <a href="_MaxThreadsBuffer.htm">#MaxThreadsBuffer</a>.</p>
<p>Unlike <a href="_MaxThreads.htm">#MaxThreads</a>, this setting is <strong>not</strong> global. Instead, position it before the first hotkey label you wish to have affected by it, which will result in all subsequent hotkeys using that value until another instance of this directive is encountered.</p>
<p>Any <a href="../Hotkeys.htm">hotkey</a> subroutine whose first line is <a href="ExitApp.htm">ExitApp</a>, <a href="Pause.htm">Pause</a>, <a href="Edit.htm">Edit</a>, <a href="Reload.htm">Reload</a>, <a href="KeyHistory.htm">KeyHistory</a>, <a href="ListLines.htm">ListLines</a>, <a href="ListVars.htm">ListVars</a>, or <a href="ListHotkeys.htm">ListHotkeys</a> will always run regardless of this setting.</p>
<p>The setting of <a href="_MaxThreads.htm">#MaxThreads</a> -- if lower than this setting -- takes precedence.</p>
<p>If this directive is unspecified in the script, it will behave as though set to 1.</p>
<h3>Related</h3>
<p><a href="_MaxThreads.htm">#MaxThreads</a>, <a href="_MaxThreadsBuffer.htm">#MaxThreadsBuffer</a>, <a href="Critical.htm">Critical</a>, <a href="../misc/Threads.htm">Threads</a>, <a href="Hotkey.htm">Hotkey</a>, <a href="_MaxHotkeysPerInterval.htm">#MaxHotkeysPerInterval</a>, <a href="_HotkeyInterval.htm">#HotkeyInterval</a>, <a href="ListHotkeys.htm">ListHotkeys</a></p>
<h3>Example</h3>
<pre class="NoIndent">#MaxThreadsPerHotkey 3</pre>

</body>
</html>
